<template>
  <view class="cancelPackage">
    <view class="box">
      <!-- <view class="line">
        <view class="title">姓名</view>
        <view class="choose">
          <u-input
            placeholder="请填写姓名"
            border="none"
            v-model="name"
            :customStyle="inputStyle"
          ></u-input>
        </view>
      </view>
      <view class="line">
        <view class="title">电话</view>
        <view class="choose">
          <u-input
            placeholder="请填写电话"
            border="none"
            v-model="phone"
            :customStyle="inputStyle"
          ></u-input>
        </view>
      </view>
	  <view class="line">
	    <view class="title">省份</view>
	    <view class="choose">
	      <u-input
	        placeholder="请填写省份"
	        border="none"
	        v-model="province"
	        :customStyle="inputStyle"
	      ></u-input>
	    </view>
	  </view>
	  <view class="line">
	    <view class="title">城市</view>
	    <view class="choose">
	      <u-input
	        placeholder="请填写城市"
	        border="none"
	        v-model="city"
	        :customStyle="inputStyle"
	      ></u-input>
	    </view>
	  </view>
	  <view class="line">
	    <view class="title">区域</view>
	    <view class="choose">
	      <u-input
	        placeholder="请填写区域"
	        border="none"
	        v-model="district"
	        :customStyle="inputStyle"
	      ></u-input>
	    </view>
	  </view> -->
      <view class="line">
        <view class="title">退货信息</view>
        <view class="choose">
          <u-input
            placeholder="请录入你的基本地址信息"
            border="none"
            v-model="address"
            :customStyle="inputStyle"
          ></u-input>
          <!-- placeholderStyle="{'font-size': '26rpx';
        'color':' #999999'}" -->
        </view>
      </view>
      <view class="btn" @click="sureSubmit">确认提交</view>
    </view>
	<!-- 选择列表 -->
	<!-- <u-picker mode="time" :show="pickerShow" :columns="pickerColumns" :defaultIndex="defaultIndex"
		@confirm="confirm" @cancel="cancel"></u-picker> -->
  </view>
</template>

<script>
export default {
  data() {
    return {
      // 姓名
      name: "",
      // 联系方式
      phone: "",
	  // 省份
	  province:"",
      // // 城市
      city: "",
	  // 区域
	  district:"",
      // 详细地址
      address: "",
	  // 选择展示
	  pickerShow: false,
	  id:""
    };
  },

  onLoad(options) {
	if(options.id){
		this.id = options.id;
	}
  },

  methods: {
    // 确认添加
    sureSubmit() {
  //     if (!this.name) {
  //       this.$u.toast("请填写姓名");
  //       return;
  //     }
  //     if (!this.phone) {
  //       this.$u.toast("请填写电话");
  //       return;
  //     }
	 //  if (!this.province) {
	 //    this.$u.toast("请填写省份");
	 //    return;
	 //  }
	 // if(!this.city){
		//   this.$u.toast("请填写城市");
		//   return;
	 // }
	 //  if (!this.district) {
	 //    this.$u.toast("请填写区域");
	 //    return;
	 //  }
      if (!this.address) {
        this.$u.toast("请录入你的基本地址信息");
        return;
      }
      let info = {
		  fid:this.id,
		  // name:this.name,
		  // phone:this.phone,
		  // province:this.province,
		  // city:this.city,
		  // district:this.district,
		  store_info:this.address
      };
	  this.$api.post({
	      url: "/ebapi/public_api/cancelShipment",
	      data: info,
	      success: (res) => {
			  uni.showToast({
			  	title:"提交成功！"
			  })
			  setTimeout(()=>{
				  uni.navigateBack()
			  },1000)
		  },
	   })
    },
  },
};
</script>

<style lang="scss">
.cancelPackage {
  padding: 24rpx;
  font-size: $uni-text-size-middle;

  .box {
    padding: 60rpx 40rpx;
    background: #ffffff;
    box-shadow: 0rpx 2rpx 10rpx 1rpx rgba(0, 0, 0, 0.08);
    border-radius: 16rpx;
    opacity: 1;

    .line {
      margin-bottom: 34rpx;

      .title {
        font-size: $uni-text-size-middle;
        margin-bottom: 20rpx;
        color: #666666;
      }
    }

    .btn {
      margin-top: 135rpx;
      padding: 30rpx 0;
      border-radius: 50rpx;
      text-align: center;
      color: #ffffff;
      font-size: $uni-text-size-title;
      background: #2354e3;
      opacity: 1;
    }
  }
}
</style>
